function [x,y,typ] = de2bi_int(job,arg1,arg2)

x=[];y=[];typ=[]
select job
case 'plot' then
    standard_draw(arg1)
case 'getinputs' then
	[x,y,typ]=standard_inputs(arg1)
case 'getoutputs' then
	[x,y,typ]=standard_outputs(arg1)
case 'getorigin' then
	[x,y]=standard_origin(arg1)
case 'set' then
	x=arg1;
	graphics=arg1.graphics;exprs=graphics.exprs
	model=arg1.model;
	x0=model.state
	rpar=model.rpar
	ns=prod(size(x0));nin=1;nout=1
	s=poly(0,'s');z=poly(0,'s')

	while %t do 
      [ok, bitNum, exprs]=getvalue(..
          'Set decimal to binary converter parameters',..
          ['number of bit per symbol';
          ],..
          list('vec',1),exprs);
      
      if ~ok then break,end
      
      if bitNum ~= int(bitNum) | bitNum < 1
        message('number of bit per symbol must be positive integer');
        ok = %f;
      end
      
      if ok then        
        graphics.exprs=exprs;
        [model,graphics,ok]=check_io(model,graphics,[1],[bitNum],[],[])
        model.ipar(1) = bitNum;
        x.graphics=graphics;x.model=model
        break
      end // if ok
	end // while loop
case 'define' then
  bitNum = 1;
  exprs=[string(bitNum)];
  model=scicos_model()
  model.sim=list('de2bi_com', 5)
  model.in = 1;
  model.out = bitNum;
  model.evtin = [];
  model.blocktype='d'
  model.dep_ut=[%t %f]
  model.ipar = bitNum;
  
  gr_i=['xstringb(orig(1),orig(2),[''decimal to'';''binary converter''],sz(1),sz(2),''fill'')']
  x=standard_define([2.5 2.5],model,exprs,gr_i)
end
endfunction
